<template>
    <div class="bed">
        <el-card class="box-card">
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="床位编号">
                    <el-input v-model="form.bednumber"></el-input>
                </el-form-item>
                <el-form-item label="所属科室">
                    <el-select placeholder="选择科室" v-model="form.department">
                        <el-option label="急诊科" value="急诊科"></el-option>
                        <el-option label="普通科" value="普通科"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="氧气罐">
                    <el-radio-group v-model="form.oxygen">
                        <el-radio label="1" value="1">是</el-radio>
                        <el-radio label="0" value="0">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="心电机">
                    <el-radio-group v-model="form.heart">
                        <el-radio label="1" value="1">是</el-radio>
                        <el-radio label="0" value="0">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="呼吸机">
                    <el-radio-group v-model="form.breath">
                        <el-radio label="1" value="1">是</el-radio>
                        <el-radio label="0" value="0">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="急救设备">
                    <el-radio-group v-model="form.icu">
                        <el-radio label="1" value="1">是</el-radio>
                        <el-radio label="0" value="0">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="空调地暖">
                    <el-radio-group v-model="form.aircondition">
                        <el-radio label="1" value="1">是</el-radio>
                        <el-radio label="0" value="0">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="电视外设">
                    <el-radio-group v-model="form.tv">
                        <el-radio label="1" value="1">是</el-radio>
                        <el-radio label="0" value="0">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="责任护士">
                    <el-select placeholder="选择护士" v-model="form.nurse">
                        <el-option label="李宁雨" value="李宁雨"></el-option>
                        <el-option label="李宁" value="李宁"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <el-popconfirm title="确定添加吗？" @confirm="log">
                <el-button type="primary" slot="reference" style="width:150px;height: 30px;line-height: 30px;padding: 0;">确认创建</el-button>
            </el-popconfirm>
            <el-button type="info" style="width:150px;height: 30px;line-height: 30px;padding: 0;margin-left: 10px;" @click="$router.back()">返回上一级</el-button>
        </el-card>

    </div>
</template>

<script>
import { api_bedtable_add } from "@/apis/indent";
export default {
    data() {
        return {
            form: {
                aircondition:'',
                bednumber:'',
                breath:'',
                department:'',
                heart:'',
                icu:'',
                nurse:'',
                oxygen:'',
                tv:''
            }
        }
    },
    methods: {
        //添加床位
        async addBed() {
            let res = await api_bedtable_add(this.form)
            // console.log(res);
        },
        log(){
           this.addBed()
        //    console.log(this.form);
           this.$router.push('/bed/index')
        },
    }
}
</script>

<style lang="less" scoped>
.bed {
    width: 100%;
    height: 100%;
    margin-top: 10px;

    .box-card {
        width: 100%;
        height: 100%;
    }
}
</style>
